package uutalk.netcloud.talk.model.bean;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by hujie on 17/4/10.
 */

public class GroupMemberWrap extends MqttBussinessBean {

    private List<GroupMember> member_list;

    public List<GroupMember> getMember_list() {
        return member_list;
    }

    public void setMember_list(List<GroupMember> member_list) {
        this.member_list = member_list;
    }


    @JSONField(deserialize = false, serialize = false)
    public List<String> getAllOnLineList() {
        List<String> list = new ArrayList<>();
        if (member_list != null && member_list.size() > 0) {
            for (GroupMember member : member_list) {
                if ("1".equals(member.getUser_status())) {
                    if (!list.contains(member.getUser_id())) {
                        list.add(member.getUser_id());
                    }
                }
            }
        }
        return list;

    }


}
